package com.ItTallents.Maria.Nikola.Ivan.cardsgame;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ExpandableListView;

 
public class StartActivity extends Activity {
 
    ExpandableListAdapter listAdapter;
    ExpandableListView expListView;
    List<String> listDataHeader;
    HashMap<String, List<String>> listDataChild;
 
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_start);
 
        // get the listview
        expListView = (ExpandableListView) findViewById(R.id.lvExp);
 
        // preparing list data
        prepareListData();
 
        listAdapter = new ExpandableListAdapter(this, listDataHeader, listDataChild);
 
        // setting list adapter
        expListView.setAdapter(listAdapter);
    }
 
    /*
     * Preparing the list data
     */
    private void prepareListData() {
        listDataHeader = new ArrayList<String>();
        listDataChild = new HashMap<String, List<String>>();
 
        // Adding child data
        listDataHeader.add("2X2");
        listDataHeader.add("2X3");
        listDataHeader.add("3X4");
        listDataHeader.add("4X4");
        listDataHeader.add("4X5");
        listDataHeader.add("5X6");
        listDataHeader.add("6X6");
        listDataHeader.add("6X7");
        listDataHeader.add("7X8");

 
        // Adding child data
        List<String> children = new ArrayList<String>();
        children.add("Easy");
        children.add("Medium");
        children.add("Hard");
        
        for (int i = 0; i < listDataHeader.size(); i++) {
        	listDataChild.put(listDataHeader.get(i), children);
		}
         // Header, Child data
       
    }
}